package pattern.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pattern.annontations.Menu;
import pattern.annontations.Secure;
import pattern.common.abstractcontroller.AbstractSystemInfoController;
import pattern.common.system.Server;
import pattern.result.ResponseData;
import pattern.routing.WorkMainApiRouting;

/**
 * @author Simon
 * @date 2020-08-21
 */
@Api(tags = "通用接口")
@ApiSort(0)
@RestController
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@Secure
@Slf4j
@RequestMapping(WorkMainApiRouting.Common.BASE)
public class CommonController extends AbstractSystemInfoController {

    @ApiOperation(value = "系统节点监控")
    @GetMapping(WorkMainApiRouting.Common.SERVER_INFO)
    @Menu(menuName = "system_info", menuUri = "system_info_monitor", foundational = false)
    public ResponseData<Server> serverInfo() throws Exception {
        return super.getServerInfo();
    }
}
